IRR
Internal Rate of Return (IRR) calculation engine, along with useful IRR functions.
This class performs XIRR (Extended Internal Rate of Return) type calculations (aka IRR with non-periodic (irregular) cashflows)
XIRR calculates the annualised return from a series of cashflows that occur on irregular dates.
It finds the interest rate that makes the present value of all cashflows equal to zero.
Author
Stuart Beesley - August 2025
Since
MD2027
Parameters
Optionally specify the list of cash flows for the IRR calculation, or null (which will be invalid).
Allows otherwise valid cashflows with values of all (or near-) zeros to report as valid.
Optional title for this IRR calculation.
Optionally specify the currency used to create the cash flows (e.g. dollars, euro, etc., not shares), or null.
Optionally specify the account used to create the cash flows (e.g. security account), or null.
See also
Constructors
Creates a new IRR calculation instance for IRR calculations and results
Types
Stores a single IRR calculation result (which may or may not have been successful)
Functions
clears all previous IRR calculation results - i.e. as if no calculations have been performed
Performs a deep clone of this IRR calculation's series of cash flows. All entries in the new / cloned list will be new / cloned cash flow entries. Refer: IRR.cloneCashFlows
Performs a deep clone of this IRR calculation's series of cash flows whilst also converting the currency and value(s). All entries in the new / cloned list will be new / cloned cash flow entries. Refer: IRR.cloneCashFlows
Computes an annualised Internal Rate of Return (IRR), sometimes referred to as the Return on Investment (ROI), for a series of irregular cash flows. Supports multiple root-solving strategies.
Indicates how many successful IRR solutions were found
returns the last IRR calculation result found out of all results, or null if none found.
returns a list of all IRR calculation results.
returns the last successful IRR calculation found out of all results, or null if none found.
returns a list of all successful IRR calculation results.
Validates the list of cash flows to ensure it meets ROI/IRR requirements:
Log IRR calculation object, its cashflows, and calculation result(s). This function makes no assumptions as to the validity of cashflows or results. The caller should ideally have called computeIRR prior to calling this method to obtain result(s).
Define the start date for this IRR calculation's series of cash flows (and thus compute/recompute the number of years to the end). This function calls ROICashFlowEntry.setStartDate on each cash flow entry.